<?php

require_once 'Zend/View/Helper/Abstract.php';

class Core_View_Helper_Content_SelectLanguage extends Zend_View_Helper_Abstract
{
    /**
     *
     */
    public function selectLanguage($name, $value, $attribs = null)
    {
        //select version
        $config = Zend_Registry::get('config');
        $siteVersions = $config->language->translations;

        foreach ($siteVersions as $locale => $label) {
            $options[$locale] = $this->view->getTranslation($label);
        }
        $form   = new Core_Form();
        $select = $form->createElement('select', $name, array(
            'multiOptions'  => $options,
            'value'         => $value,
        ));
        if (is_array($attribs)) {
            $select->setAttribs($attribs);
        }
        return $select;
    }
}